package com.yt.product.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.product.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.product.mapper.ProductCategoryRelationMapper;
import com.yt.product.models.service.IProductCategoryRelationService;
import com.yt.product.models.bo.ProductCategoryRelationSaveBO;
import com.yt.product.models.dto.ProductCategoryRelationDTO;

/**
 * 产品类目关系表控制器
 *
 * @author lvzeming
 * @Date 2025-08-11 22:57:17
 */
@DubboService
public class ProductCategoryRelationServiceImpl extends ServiceImpl<ProductCategoryRelationMapper, ProductCategoryRelationDTO> implements IProductCategoryRelationService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(ProductCategoryRelationSaveBO saveBO) {
        ProductCategoryRelationDTO dto = new ProductCategoryRelationDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
